import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;

public class Demo21 {
	private static int count=0;
	public static void main(String[] args) throws InterruptedException {

		Semaphore semaphore=new Semaphore(2);
		semaphore.acquire(); {
			for(int i =0;i<50000;i++) {
				count++;
			}
		}
		semaphore.acquire();{
			for(int i = 0;i<50000;i++) {
				count++;
			}
		}
		System.out.println("count:"+count);
	}
}
